package com.zy.ioc.pro5_ioc_import;

import com.zy.ioc.pro5_ioc_import.other.Apple;
import com.zy.ioc.pro5_ioc_import.other.Banana;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

/**
 * @program: mavenTest153
 * @description: 利用配置类中的@Bean和@Import加载第三方的Bean
 * @author: zy
 * @create: 2025-07-13 08:38
 */
@Configuration
@Import(value={Apple.class, Banana.class})  // 导入第三方的Bean,question: 导入的第三方的Bean的id是啥?  com.zy.pro5_ioc_import.other.Apple
public class AppConfig_1 {

    @Bean
    public Apple a(){
        return new Apple();   // <bean id="a" class="com.zy.pro5_ioc_import.other.Apple"/>
    }
}
